//
//  FCBottomTransactionhistoryCell.m
//  FundChain
//
//  Created by 肖浩然的mac on 2018/3/1.
//  Copyright © 2018年 RUIXIN. All rights reserved.
//

#import "FCBottomTransactionhistoryCell.h"

@implementation FCBottomTransactionhistoryCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
        [self setSubView];
    }
    return self;
}
-(void)setSubView{
    /* 月份 */
    self.monthLabel = [UILabel new];
    [self addSubview:self.monthLabel];
    [self.monthLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(30*KScreenHeightScale1334);
        make.left.mas_equalTo(30*KScreenWidthScale750);
    }];
//    self.monthLabel.text = @"25JAN";
    self.monthLabel.font = Kfont(48);
    /* 交易类型 */
    self.typeImageView = [UIImageView new];
    [self addSubview:self.typeImageView];
    [self.typeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.monthLabel);
        make.left.mas_equalTo(self.monthLabel.mas_right).offset(60*KScreenWidthScale750);
    }];
    self.typeImageView.image = [UIImage imageNamed:@"-"];
    /* 交易金额 */
    self.amountLabel = [UILabel new];
    [self addSubview:self.amountLabel];
    [self.amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.monthLabel);
        make.right.mas_equalTo(-30*KScreenWidthScale750);
    }];
//    self.amountLabel.text = @"1.358189";
    self.amountLabel.font = Kfont(32);
    /* 地址 */
    self.addressLabel = [UILabel new];
    [self addSubview:self.addressLabel];
    [self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.amountLabel.mas_bottom).offset(20*KScreenHeightScale1334);
        make.right.mas_equalTo(self.amountLabel);
        make.left.mas_equalTo(self.monthLabel.mas_right).offset(60*KScreenWidthScale750);
    }];
//    self.addressLabel.text = @"1dfwr 5efo sdwy 15sd op5q hjet 53wq qdfxw";
    self.addressLabel.font = Kfont(24);
    self.addressLabel.numberOfLines = 2;
    self.addressLabel.textColor = kOrderColor;
    /* 具体时间 */
    self.timeLabel = [UILabel new];
    [self addSubview:self.timeLabel];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.addressLabel.mas_bottom).offset(10*KScreenHeightScale1334);
        make.right.mas_equalTo(self.amountLabel);
    }];
//    self.timeLabel.text = @"2018-01-25 14:20:25";
    self.timeLabel.font = Kfont(24);
    self.timeLabel.textColor = kGrayColor;
    
}
//setter
-(void)setTransactionHistoryDetailModel:(FCTransactionHistoryDetailModel *)transactionHistoryDetailModel{
    _transactionHistoryDetailModel = transactionHistoryDetailModel;
   
    self.monthLabel.text = transactionHistoryDetailModel.sendData;
    
    if ([transactionHistoryDetailModel.isSend isEqualToString:@"1"]) {
        self.typeImageView.image = [UIImage imageNamed:@"-"];
        
    }else{
         self.typeImageView.image = [UIImage imageNamed:@"+"];
    }
    self.amountLabel.text = transactionHistoryDetailModel.amount;
    self.addressLabel.text = transactionHistoryDetailModel.address;
    self.timeLabel.text = [FCLocalUserHelper getBabyDetailAge:transactionHistoryDetailModel.sendTime];
    
}

@end
